package org.uiot.protocol.group

enum Subjection {
    Packet(0), Calculation(1), Composite(2), KeyValue(3)
    final int value

    private Subjection(int value) { this.value = value }

    static Subjection byValue(int val) {
        values().find { it.value == val } ?:
                { throw new IllegalArgumentException("Subjection ${val} not found") }()
    }
}